package com.lemon.soft.bookingroom.controller;

import java.util.Arrays;
import java.util.Map;


import com.lemon.soft.bookingroom.util.PageUtils;
import com.lemon.soft.bookingroom.util.R;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.lemon.soft.bookingroom.entity.RoomTypesEntity;
import com.lemon.soft.bookingroom.service.RoomTypesService;



/**
 * 
 *
 * @author ${author}
 * @email ${email}
 * @date 2025-05-29 12:38:52
 */
@Tag(name = "房间类型",description = "不用理会房间类型")
@RestController
@RequestMapping("bookingroom/roomtypes")
public class RoomTypesController {
    @Autowired
    private RoomTypesService roomTypesService;

    /**
     * 列表
     */
    @GetMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = roomTypesService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 保存
     */
    @PostMapping("/save")
    public R save(@RequestBody RoomTypesEntity roomTypes){
		roomTypesService.save(roomTypes);

        return R.ok();
    }

    /**
     * 修改
     */
    @PostMapping("/update")
    public R update(@RequestBody RoomTypesEntity roomTypes){
		roomTypesService.updateById(roomTypes);

        return R.ok();
    }

    /**
     * 删除
     */
    @PostMapping("/delete")
    public R delete(@RequestBody Integer[] typeIds){
		roomTypesService.removeByIds(Arrays.asList(typeIds));

        return R.ok();
    }

}
